package com.threadExample;

/**
 * @author yijy
 * @description
 * @create 2021/4/2 下午2:36
 **/
public class ThreadLocalTest1 {

    static ThreadLocal threadLocal = new InheritableThreadLocal();

    public static void main(String[] args) {
        threadLocal.set("你好！");
        ThreadLocal threadLocals = new ThreadLocal();
        threadLocals.set("你好呀");
        Thread thread = new Thread(()->{
            System.out.println(Thread.currentThread().getName()+"," + threadLocal.get());
            System.out.println(Thread.currentThread().getName()+"," + threadLocals.get());
        });
        thread.start();

    }
}
